import { CategoryList } from "./model/categoryModel";
import request from "@/utils/request";

const enum Api {
  getCategory1List = "/admin/product/getCategory1",
  getCategory2List = "/admin/product/getCategory2",
  getCategory3List = "/admin/product/getCategory3",
}

export const getCategoryListApi = () => {
  return request.get<any, CategoryList>(Api.getCategory1List);
};

export const getCategory2ListApi = (category1Id: number) => {
  return request.get<any, CategoryList>(
    Api.getCategory2List + `/${category1Id}`
  );
};

export const getCategory3ListApi = (category2Id: number) => {
  return request.get<any, CategoryList>(
    Api.getCategory3List + `/${category2Id}`
  );
};
